package generator;

import java.util.*;

public class GenerateSCBindingSites {

	public static String generateSCBindingSites(Vector<Vector<Double>> randomMotif)
	{
		String currSequence = "";
		for (Vector<Double> seq : randomMotif)
		{
			double cum = 0.0;
			double currNum = Math.random();
			for (int i = 0; i < seq.size(); i++)
			{
				cum += seq.get(i);
				if (currNum < cum)
				{
					if (i == 0)
					{
						currSequence += "A";
						break;
					} // a
					else if (i == 1)
					{
						currSequence += "T";	
						break;
					}
					else if (i == 2)
					{
						currSequence += "G";	
						break;
					}
					else
					{
						currSequence += "C";
						break;
					}
				}
			}
		}
		return currSequence;
	}
}
